package com.gettec.lims.client;

import com.extjs.gxt.ui.client.Registry;
import com.extjs.gxt.ui.client.Style.LayoutRegion;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.widget.layout.BorderLayoutData;
import com.gettec.lims.client.components.MainPanel;
import com.gettec.lims.client.components.NavigationPanel;
import com.gettec.lims.client.services.NnimsService;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.RootPanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class NLIMS implements EntryPoint {
	/**
	 * The message displayed to the user when the server cannot be reached or
	 * returns an error.
	 */
	private static final String SERVER_ERROR = "An error occurred while "
			+ "attempting to contact the server. Please check your network "
			+ "connection and try again.";

	/**
	 * Create a remote service proxy to talk to the server-side Greeting service.
	 */
	/*private final GreetingServiceAsync greetingService = GWT
			.create(GreetingService.class);*/

	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad() {
		Registry.register(NlimsConstants.SERVICE,  
		        GWT.create(NnimsService.class));  
		Viewport viewport = new Viewport();  
		 
		BorderLayout b=new BorderLayout();
		
		BorderLayoutData centerData = new BorderLayoutData(LayoutRegion.CENTER);  
		centerData.setCollapsible(false);  
		BorderLayoutData westData = new BorderLayoutData(LayoutRegion.WEST,155);  
		westData.setCollapsible(true);  
		westData.setSplit(true);  
		NavigationPanel  navPanel= new NavigationPanel();  
		MainPanel  mainPanel= new MainPanel();  
		viewport.add(mainPanel, centerData);  
		viewport.add(navPanel, westData);  
		viewport.setLayout(b);
		RootPanel rootPanel = RootPanel.get();
		rootPanel.add(viewport);
		
	}
}
